<ix-modal-header [requiredRoles]="requiredRoles" [title]="title" [loading]="isFormLoading()"></ix-modal-header>

<mat-card>
  <mat-card-content>
    <form class="ix-form-container" [formGroup]="form" (submit)="onSubmit()">
      <ix-fieldset>
        <ix-select
          formControlName="type"
          [label]="'Type' | translate"
          [required]="true"
          [options]="types$"
        ></ix-select>

        <ix-input
          formControlName="var"
          [label]="'Variable' | translate"
          [required]="true"
          [tooltip]="tooltips.var | translate"
        ></ix-input>

        <ix-textarea
          formControlName="value"
          [label]="'Value' | translate"
          [required]="true"
          [tooltip]="tooltips.value | translate"
        ></ix-textarea>

        <ix-input
          formControlName="comment"
          [label]="'Description' | translate"
        ></ix-input>

        <ix-checkbox
          formControlName="enabled"
          [label]="'Enabled' | translate"
        ></ix-checkbox>
      </ix-fieldset>

      <ix-form-actions>
        <button
          *ixRequiresRoles="requiredRoles"
          mat-button
          type="submit"
          color="primary"
          ixTest="save"
          [disabled]="form.invalid || isFormLoading()"
        >
          {{ 'Save' | translate }}
        </button>
      </ix-form-actions>
    </form>
  </mat-card-content>
</mat-card>
